package com.work.washer.aa;

import org.springframework.data.annotation.CreatedDate;
import xyz.erupt.annotation.Erupt;
import xyz.erupt.annotation.EruptField;
import xyz.erupt.annotation.sub_field.*;
import xyz.erupt.annotation.sub_field.sub_edit.ChoiceType;
import xyz.erupt.annotation.sub_field.sub_edit.VL;
import xyz.erupt.jpa.model.BaseModel;

import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;

/**
 * 
 * @TableName user
 */
@Erupt(name = "用户")
@Table(name = "s_user")
@Entity
public class User extends BaseModel {


    /**
     * 
     */
    @EruptField(
            views = @View(title = "名称"),
            edit = @Edit(title = "名称") //相当于 type = EditType.INPUT
    )
    private String name;

    /**
     * 
     */
    @EruptField(
            views = @View(title = "手机号"),
            edit = @Edit(title = "手机号") //相当于 type = EditType.INPUT
    )
    private String phone;

    @EruptField(
            views = @View(title = "类型"),
            edit = @Edit(title = "类型", notNull = true, type = EditType.CHOICE,
                    choiceType = @ChoiceType(vl = {
                            @VL(value = "1", label = "乘客"),
                            @VL(value = "2", label = "司机"),
                    }),readonly = @Readonly(edit = true))
    )
    private Integer type;

    @EruptField(
            views = @View(title = "是否启用"),
            edit = @Edit(title = "是否启用", notNull = true, type = EditType.CHOICE,
                    choiceType = @ChoiceType(vl = {
                            @VL(value = "1", label = "启用"),
                            @VL(value = "0", label = "禁用"),
                    }))
    )
    private Integer state;

    /**
     * 
     */

    @EruptField(
            views = {
                    @View(title = "身份证", type = ViewType.IMAGE)
            }
    )
    private String idcardFront;

    /**
     * 
     */
    @EruptField(
            views = {
                    @View(title = "身份证", type = ViewType.IMAGE)
            }
    )
    private String idcardBack;

    /**
     * 
     */
    @EruptField(

            views = @View(title = "密码",show = false),
            edit = @Edit(title = "密码" ,readonly = @Readonly(edit = true ))

    )
    private String pwd;

    /**
     * 
     */
    @EruptField(
            views = {
                    @View(title = "头像", type = ViewType.IMAGE)
            }
    )
    private String headImg;
    @EruptField(
            views = {
                    @View(title = "附件", type = ViewType.IMAGE)
            }
    )
    private String img1;
    @EruptField(
            views = {
                    @View(title = "附件", type = ViewType.IMAGE)
            }
    )
    private String img2;
    @EruptField(
            views = {
                    @View(title = "附件", type = ViewType.IMAGE)
            }
    )
    private String img3;
    @EruptField(
            views = {
                    @View(title = "附件", type = ViewType.IMAGE)
            }
    )
    private String img4;
    @EruptField(
            views = {
                    @View(title = "附件", type = ViewType.IMAGE)
            }
    )
    private String img5;
    @EruptField(
            views = {
                    @View(title = "附件", type = ViewType.IMAGE)
            }
    )
    private String img6;



    /**
     * 
     */
    @EruptField(
            views = @View(title = "创建时间"),
            edit = @Edit(title = "创建时间" )
    )
    @CreatedDate
    private Date createDate;
}